import request from '@/utils/request'
const baseUrl = '/cz-messaging/api/v1/platformNotices' //系统公共
// import {getMessages } from '@/api/sysMessag/index' 

/*
###
# 公共:查询分页列表
# 过滤条件: 公告标题:title  接收用户类型:platformType 5-贷代 10-箱东 15-箱贸易 20-集卡车队 25-堆场 30-所有用户
# status:状态 5-待发布 10-已发布 15-已撤销  发布时间区间: 开始时间:beginPublishDate  结束时间: endPublishDate
*/
export const getPlatformNotices = (data:any) => { 
  return request({
    url: baseUrl+'/page',
    method: 'post',
    data: data
  })
}
export const addPlatformNotices = (data:any) => { 
  return request({
    url: baseUrl,
    method: 'post',
    data: data
  })
}
export const getPlatformNoticesList = (data:any) => { 
  return request({
    url: baseUrl+'/list',
    method: 'post',
    data: data
  })
}
/*根据id查询详情
*/
export const getDetailsById = (id) => {
  return request({
    url: baseUrl + '/' + id,
    method: 'GET',
  })
}
/*
更新
*/
export const setRead = (data) => {
  return request({
    url: baseUrl,
    method: 'PUT',
    data
  })
}
//批量删除
export const deleteIds = (ids: any) => {
  return request({
    url: baseUrl,
    method: 'DELETE',
    data:ids
  })
}
/*
 撤销
# POST {{baseUrl}}/page
*/
export const revoke = (data: any) => {
  return request({
    url: baseUrl + '/revoke',
    method: 'PUT',
    data:data
  })
}